package com.heima.behavior.controller;

import com.heima.behavior.dto.LikesBehaviorDto;
import com.heima.behavior.service.ILikeService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//行为微服务功能实现
@RestController
@RequestMapping("api/v1/likes_behavior")
@Api(tags = "APP点赞行为表接口")
@CrossOrigin
public class LikeController {

    @Autowired
    private ILikeService likeService;

    /**
     * 点赞
     * @param dto
     * @return
     */
    @PostMapping
    public ResponseResult saveLike(@RequestBody LikesBehaviorDto dto) {
        return likeService.saveLike(dto);
    }
//    文章喜欢记录
    @PostMapping("/getLikes")
    public ResponseResult getLikes(@RequestBody LikesBehaviorDto dto){
        return likeService.getLikes(dto);
    }
}
